aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/[username]')
-rw-r--r--src/routes/(app)/[username]/receive/+page.svelte26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte
index 9a696929..56bb1f92 100644
--- a/src/routes/(app)/[username]/receive/+page.svelte
+++ b/src/routes/(app)/[username]/receive/+page.svelte
@@ -1,5 +1,5 @@
<script>
- import { run } from 'svelte/legacy';
+ import { run } from "svelte/legacy";
import { send } from "$lib/socket";
import { btc, post, copy, f, get, types, sat, s, sats } from "$lib/utils";
@@ -27,10 +27,8 @@
let rate = rates[currency];
let type = types.lightning;
let hash = "";
-
let qr;
-
let aid = subject.id;
let invoice = $state({
aid,
@@ -38,7 +36,9 @@
items: [],
user: subject,
});
- let amount = $state(), amountFiat, tip;
+ let amount = $state(),
+ amountFiat,
+ tip;
let setType = async (type) => {
invoice.type = type;
@@ -71,22 +71,25 @@
goto(url, { invalidateAll: true, noScroll: true });
};
- let newAmount;
+ let newAmount = $state();
let settingAmount = $state();
+ let fiat = $state(true);
let toggleAmount = () => (settingAmount = !settingAmount);
let submit;
run(() => {
refresh(data);
});
- let link = $derived([types.bitcoin, types.liquid].includes(type)
- ? text
- : `lightning:${text}`);
- let txt = $derived([types.bitcoin, types.liquid].includes(type) ? hash : text);
+ let link = $derived(
+ [types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`,
+ );
+ let txt = $derived(
+ [types.bitcoin, types.liquid].includes(type) ? hash : text,
+ );
</script>
<div class="invoice container mx-auto max-w-xl px-4 space-y-2">
<InvoiceData
- {src}
+ {src}
{link}
{qr}
{txt}
@@ -116,12 +119,13 @@
</div>
<SetAmount
+ bind:newAmount
+ bind:fiat
{currency}
{rate}
{submit}
{settingAmount}
{setAmount}
- {newAmount}
{toggleAmount}
amountPrompt={$amountPrompt}
t={$t}